#ifndef __PROP_H_
#define __PROP_H_

#include <MyString.h>

enum Effect
{
    Frozen = 1,//冰冻
    SuckBlood,//吸血
    Reflex, //荆棘
    Combo //连击
};

enum PropType
{
    Weapon,
    Defence,
    Medicament
};

struct Prop
{
    enum PropType type;//道具类型
    void *ptr;//指向道具的指针
};
typedef struct Prop prop;

prop *CreateProp(enum PropType type,void *ptr);
void FreeProp(void *p,void (*ClearPtr)(void *));

struct Weapon
{
    // int id;
    MyStr name;
    int ATK;
    int Maxcount;
    int count;
    enum Effect effect;
};
typedef struct Weapon weapon;

weapon *CreateWeapon(const char *name,int ATK,enum Effect effect,int count);
void FreeWeapon(void *ptr);
MyStr WeaponToString(weapon *w);


struct Defence
{
    // int id;
    MyStr name;
    int DEF;
    int Maxcount;
    int count;
    enum Effect effect;
};
typedef struct Defence defence;

defence *CreateDefence(const char *name,int DEF,enum Effect effect,int count);
void FreeDefence(void *ptr);
MyStr DefenceToString(defence *d);


struct Medicament
{
    MyStr name;
    int HP;
    // int id;
    int count;
    enum Effect effect;
};
typedef struct Medicament medicament;

medicament *CreateMedicament(const char *name,int HP,enum Effect effect);
void FreeMedicament(void *ptr);
MyStr MedicamentToString(medicament *m);

// void JudgeEffect(player *p,monster *m);



#endif